<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>这是属性选择器</title><!-- CSS -->
  <style>
    div {
      background-color: green;
    }
    [class*="demo"] {
      background: #ddd;
      color: #999;
      cursor: not-allowed;
    }
    /* 选中所有输入框类型为"密码"的元素 */
    [class^="demo1"] {
      border-color: red;
      color: red;
    }
    [class="demo2"] {
      color: green;
    }
    [class*="zh"] {
      font-size: 20px;
    }
    [class="zh8"] {
      color: #00539F;
    }
  </style>
</head>
<body>
<!-- HTML -->

<div class="xingming">你好</div>
<div class="demo">你好</div>
<div class="demo1">你好</div>
<div class="demo2">你好</div>
<div class="zhangfei">你好</div>
<div class="zh8">你好</div>
<div class="zhang5">你好</div>
<div class="zh">你好</div>
<div class="zhan">你好</div>
<div class="zh5">你好</div>
</body>
</html>